[F1T-11] Implement Navigation Functions into ROS - Version 2#13
[F1T-11] Implement Navigation Functions into ROS - Version 2#13
Conversation
- Subscribes to Odometry data from /ego_racecar/Odom - Callback function: 1. Processes Odom data 2. Calculates the desired heading, steering angle, and velocity (and acceleration, but may be unnecessary) - Makes use of a temporary find_desired_velocity() function, waiting on that PR to be approved and merged to main.
|
In future can you use the PR template which is provided. All you have to do is |
richarJ2002
left a comment
There was a problem hiding this comment.
Overall the function call is good however the commenting needs improving. When people read code what they tend to do is follow the comments and not the actual code. Even if the code is self explanatory it can be hard to read so just make sure you put a simple line explaining what each function call is. It may seem excessive but when dealing with robotics and developers shouting things at them in code is usually a good practice.
I would also say you need to think more on readability. Remember, your code will be read more times then it is written so try make things easy.
Overall though really good. Sorry for blunt comments I am too bust to care about tone atm.
navigation.py
Outdated
| from nav_msgs.msg import Odometry | ||
| from F1TenthAlgorithms.desired_acceleration import find_desired_acceleration | ||
| from F1TenthAlgorithms.desired_heading import find_desired_heading | ||
| from F1TenthAlgorithms.proportional_steering_angle import find_proportional_control_steering_angle |
There was a problem hiding this comment.
It would be better if there was an init.py file which did these imports for us an all you had to do was
from F1TenthAlgorithms import <function>.
Please do this in the F1TTenthAlgorithms folder.
Use this video to see what I mean https://www.youtube.com/watch?v=eUqLH1m92Yc&ab_channel=2MinutesPy
There was a problem hiding this comment.
Ok I think I've done this now: f5a7a06
Pls check init.py file to see if thats what you meant. The changes I've made have allowed me to directly import the functions as if F1TenthAlgorithms is a package so I think I did it correctly
There was a problem hiding this comment.
I don't know what the all does. It looks fine otherwise but could you explain what it does? If its not needed then I say get rid of it just to keep it simple.
…functions_version_2
…functions_version_2
- Adjusted import order - Rm temporary velocity function and math import - Removed contents of main function, but kept function to use as entrypoint - Added references to tickets for TODOs
…nction - Also corrected topic parameter from /odom to /egoracecar/odom
…anges to navigation.py - __init__.py file allows us to directly import functions from the F1TenthAlgorithms scripts - Changes were made to navigation.py to follow the coding conventions from notion
- From /egoracecar/odom to /ego_racecar/odom
Description
Creates a "Navigation" Node, that subscribes to Odometry data and uses a callback function to:
I created a temporary find_desired_velocity() function. Still waiting on the requested changes to be implemented on the velocity PR and then to be approved and merged to main.
main() function still needs work. Can't be 100% sure of layout until tickets are integrated.
Jira Link
[F1T-11]
https://jason2richards.atlassian.net/jira/software/projects/F1T/boards/2?selectedIssue=F1T-11